/**     
 * @{#} Assert.java Create on 2011-7-22 下午12:10:28     
 *     
 * Copyright (c) 2011 by xiaofeng.zhouxf     
 */
package com.sefer.memcached.utils;

import com.sefer.memcached.constants.ErrorCode;
import com.sefer.memcached.exception.ClientException;

/**
 * @author <a href="mailto:xiaofeng.zhouxf83@gmail.com">xiaofeng.zhouxf</a>
 * @version 1.0
 */
public final class Assert {

	public static boolean assertTrue(boolean expression, String message)
			throws ClientException {
		if (!expression) {
			throw new ClientException(ErrorCode.E_400, message);
		}
		return true;
	}

	public static boolean assertTrue(boolean expression) throws ClientException {
		return assertTrue(expression, "");
	}
}
